

class Vertex_Record{
public:
    Vertex_Record(unsigned short int vid, float x, float y){
		Vertex_Record::vid=vid;
		Vertex_Record::x=x;
		Vertex_Record::y=y;
	}


	unsigned short int vid;
	float x;
	float y;
};


class Edge_Record{
public:
	Edge_Record(){}
    Edge_Record(unsigned short int eid, unsigned short int left, unsigned short int right, float length){
		Edge_Record::eid=eid;
		Edge_Record::left=left;
		Edge_Record::right=right;
		Edge_Record::length=length;
	}


	unsigned short int eid;
	unsigned short int left;
	unsigned short int right;
	float length;

};


class Object_Record{
public:
    Object_Record(unsigned short int oid, unsigned short int eid, float distance){
		Object_Record::oid=oid;
		Object_Record::eid=eid;
		Object_Record::distance=distance;
	}


	unsigned short int oid;
    unsigned short int eid;
	float distance;
};

struct ParcelMng_t
{
	RectF_t					stRect;
	char					cDivX;
	char					cDivY;
	char					cFlag;
	long					lNodeOffset;
	long					lNodeCnt;
	long					lEdgeOffset;
	long					lEdgeCnt;
	long					lObjectOffset;
	long					lObjectCnt;
	vector<ParcelMng_t*>	vecParcelMng;
};

class MapData{
public:
	MapData();
	~MapData();
	bool RequestData(float x1, float y1, float x2, float y2);

	vector<Object_Record> or;
	vector<Edge_Record> er;
	vector<Vertex_Record> vr;

	ParcelMng_t	        m_stParcelMng;
private:

	void parseParcelMng(ParcelMng_t* pstParcelMng, char** ppcData);
	void parseParcelData(ParcelMng_t* pstParcelMng, PointF_t pt1, PointF_t pt2);

	FILE				*m_fp;
	FileInfo_t			m_stFileInfo;
	char				*m_pcBuff;
};



